package com.happy.shiro.config.shiro;

import org.apache.shiro.cache.AbstractCacheManager;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheException;
import org.springframework.cache.CacheManager;

public class ShiroRedisCacheManger extends AbstractCacheManager {

    private CacheManager cacheManager;

    public ShiroRedisCacheManger(CacheManager cacheManager) {
        this.cacheManager = cacheManager;
    }


    @Override
    protected Cache createCache(String s) throws CacheException {
        return new ShiroRedisCache(cacheManager.getCache(s));
    }
}
